//
//  FindNormalCell.swift
//  JTYP
//
//  Created by Groot on 2017/12/13.
//  Copyright © 2017年 inspur. All rights reserved.
//

class FindNormalCell: UICollectionViewCell {
    
    static let CellIdentifier = String(describing: FindNormalCell.self)

    @IBOutlet weak var iconView: UIImageView!
    @IBOutlet weak var titleLab: UILabel!
    @IBOutlet weak var timeLab: UILabel!
    
    override func awakeFromNib() {
        iconView.layer.borderWidth = 1
        iconView.layer.borderColor = UIColorFromRGB(rgbValue: 0xEEEEEE).cgColor
        iconView.clipsToBounds = true
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        iconView.layer.cornerRadius = iconView.bounds.size.height / 2.0
        
    }
    
    func setData(obj: Notice) {
        iconView.yy_setImage(with: URL.init(string: "\(obj.pictures?.first?.url ?? "")"), placeholder: UIImage.init(named: "pyq_creat_fbgg"))
        titleLab.text = obj.title
        timeLab.text = "发布时间：\(obj.publishtime?.prefix(10) ?? "")"
    }
}
